projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b66adf
)
Fix color leak
author
Po Lu
<luangruo@yahoo.com>
Mon, 7 Mar 2022 11:53:52 +0000
(19:53 +0800)
committer
Po Lu
<luangruo@yahoo.com>
Mon, 7 Mar 2022 11:53:52 +0000
(19:53 +0800)
* src/xterm.c (x_alloc_nearest_color_1): Don't allocate colors
multiple times when searching for a closest match.
src/xterm.c
patch
|
blob
|
history
diff --git
a/src/xterm.c
b/src/xterm.c
index 0432bd78c6ea1ebabc2789c892c0185a71c25979..1befa97fd14bba95e0a9610f4ce98a0fa53749e7 100644
(file)
--- a/
src/xterm.c
+++ b/
src/xterm.c
@@
-3882,12
+3882,8
@@
x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color)
temp.red = cells[x].red;
temp.green = cells[x].green;
temp.blue = cells[x].blue;
- status = XAllocColor (dpy, cmap, &temp);
- if (status)
- {
- nearest = x;
- nearest_delta = trial_delta;
- }
+ nearest = x;
+ nearest_delta = trial_delta;
}
}
color->red = cells[nearest].red;